package com.gezi.admin.module.sys.role;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gezi.admin.module.config.BaseEntity;
import com.gezi.admin.module.sys.role.model.SysRoleAddParamModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author 格子软件
 * @createDate 2024/2/10 09:00
 * @contact 公众号：格子软件 微信：13716343106 邮箱：1424529270@qq.com
 */
@Data
@TableName("sys_role")
public class SysRoleEntity extends BaseEntity {

  @ApiModelProperty(value = "角色名称")
  private String name;

  @ApiModelProperty(value = "权限标识")
  private String permission;

  @ApiModelProperty(value = "是否使用")
  @TableField(value = "is_use")
  private Boolean isUse;

  @ApiModelProperty(value = "排序")
  private Integer sort;

  @ApiModelProperty(value = "备注")
  private String remark;

  public void setData(SysRoleAddParamModel role) {
    this.name = role.getName();
    this.permission = role.getPermission();
    this.sort = role.getSort();
    this.remark = role.getRemark();
  }
}